package com.great.start;
import com.xiaoleilu.hutool.http.HttpUtil;
import com.xiaoleilu.hutool.json.JSONObject;
import com.xiaoleilu.hutool.json.JSONUtil;

/**
 * 获取配置文件
 * @author Administrator
 *
 */
public class GetProperties {
	
	private static String url = "http://www.xxbuff.com/GreatProject/config";
	
	private static String config = "";
	static {
		config = HttpUtil.get(url);
	}
	
	public static String getName(String name){
		try {
			
			return PropVal(name);
			
		} catch (Exception e) {
			e.printStackTrace();
			return "";
		}
	}
	
	public static String PropVal(String name){
		JSONObject configJson = JSONUtil.parseObj(config);
		
		String val = configJson.getStr(name);
		
		Util.print_sys("PropVal get name="+val+"");
		
		return val;
	}
}
